<template>
	<!-- 导航 -->
	<div class="bigVideoDetail">
		<div class="bigVideoDetail-left">
			<div class="bigVideo-box Video_box">
				<video class="bigVideo pic_width Video_pic" :src="getImgPath(videoSrc || '')" type="video/mp4" autoplay="autoplay" controls="controls"
					loop="-1"></video>
			</div>
			<div class="bigPic_title">
				<p class="title">{{ title }}</p>
				<heat :type="'video'" @comment="comment" :detailInfo='detailInfo'  @handleMouseEnter="handleMouseEnter" :getNewTotalComments='getNewTotalComments'></heat>
			</div>
		</div>
		<div class="bigVideoDetail-right">
			<hotVideos :title='hotTitle'></hotVideos>
		</div>
		<div class="commentmodel"  :class='isComment?"rightBoxVisible":"rightBoxHidden"' :style="{width:width+'px'}">
			<comment :type="'video'" @closeClick='closeClick'></comment>
		</div>
		<!-- <div class="QRcode" v-if="isCode"></div> -->
	</div>
</template>
<script>
	import { defineAsyncComponent } from 'vue';	
	export default {
		props: ['router'],
		emit:['getRouters'],
		components: {
			hotVideos:defineAsyncComponent(() => import(rootPath+'/src/components/video/hotVideos.vue')),
			heat:defineAsyncComponent(() => import(rootPath+'/src/components/video/heat.vue')),
			comment:defineAsyncComponent(() => import(rootPath+'/src/components/comment/comment.vue')),
		},
		data() {
			return {
				hotTitle: '热门视频',
				isComment: false,
				width:380,
				isCode:false,
				videoSrc:'',
				//
				title: '',
				contentDetail: {},
				detailInfo: {},
				isUp: '', // 查看是否点赞；
				query: GetQueryString(),
				Path:getRootPath(),
				isFavorite: '', //是否收藏
				hotPics: '热门图集',
				constentNextList: {}, //内容下一页
				constentprevList: {}, //内容上一页
				isShowRec: '',
				getNewTotalComments:0,
			};
		},
		created() {
			
		},
		mounted() {
			this.$nextTick(()=>{
				this.getContentOfChannel();
				this.commentSetUp();
			})
		},
		methods: {
			hoverrouterNav(index) {
				this.ActiveIN = index;
			},
			comment() {
				this.isComment = true
				// this.width = 380
			},
			closeClick() {
				this.isComment = false
			},
			handleMouseEnter(val){
				this.isCode=true
			},
			getContentOfChannel() {
				let param = {
					id: this.query.id
				};
				contentApi.getContentDetail(param, res => {
					if (res.code == '00000 00000') {
						this.detailInfo = res.data;
						this.title = res.data.title;
						this.$emit('getRouters', res.data.frontChannelLevelVos);
						this.contentDetail = res.data.instance.instanceItems.filter(item => item.field == 'videoUpload_head')[0] || {};
						this.videoSrc = this.contentDetail?.value[0]?.url;
					} else {
					}
				});
			},
			getImgPath(url){
				return imgPath(url);
			},
			commentSetUp(){
				contentApi.commentSetUp({}, res => {
					if (res.code == '00000 00000') {
						sessionStorage.commentAllowedLink = res.data.commentAllowedLink;
						sessionStorage.commentSet = res.data.commentSet;  //1 评论不限制，2 登陆后评论，3 不允许评论；
					} else {
					}
				});
			},
			getTotal(val){ // 获取总评论数
				this.getNewTotalComments = val;
			},
		}
	};
</script>

<style scoped>
.bigVideoDetail {
  width: 100%;
  height: calc(100% - 40px);
  box-sizing: border-box;
  display: flex;
  background: #222222;
	position: relative;
}
.bigVideoDetail .bigVideoDetail-left {
  background: #0d0d0d;
  flex: 1;
  position: relative;
}
.bigVideoDetail .bigVideoDetail-left .bigVideo-box {
  padding: 78px 70px;
  box-sizing: border-box;
  height: calc(100% - 96px);
	display: flex;
	align-items: center;
	justify-content: center;
}
.bigVideoDetail .bigVideoDetail-left .bigVideo {
  max-height: 104%;
}
.bigVideoDetail .bigVideoDetail-left .bigPic_title {
  height: 96px;
  width: 100%;
  max-height: 100%;
  height: auto;
  padding: 0 31px;
  box-sizing: border-box;
	margin-bottom: 24px;
}
.bigVideoDetail .bigVideoDetail-left .title {
  font-size: 24px;
  font-family: PingFang SC-Medium, PingFang SC;
  font-weight: 500;
  color: #e8e8e8;
  line-height: 32px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  margin-bottom: 24px;
}
.bigVideoDetail .bigVideoDetail-right {
  width: 380px;
  background: #222222;
  padding: 24px;
  box-sizing: border-box;
  height: 100%;
	overflow-y:auto;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation .smallVideo-box {
  width: 81px;
  height: 45px !important;
  margin-right: 6px;
  margin-bottom: 6px;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation .smallVideo-box .smallVideo {
  width: 100%;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation .smallVideo-box:nth-of-type(3n) {
  margin-right: 0;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation .btn_span_box {
  margin-top: 20px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation .btn_span_box .btn_span {
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 14px;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #e8e8e8;
  line-height: 22px;
  display: inline-block;
  text-align: center;
  cursor: pointer;
}
.bigVideoDetail .bigVideoDetail-right .pic_pagenation .btn_span_box .btn-aa {
  background: #ff3333;
}
.bigVideoDetail .bigVideoDetail-right .currentPage {
  font-size: 18px;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #E8E8E8;
  line-height: 18px;
}
.bigVideoDetail .bigVideoDetail-right .currentPage .currentPages {
  font-size: 30px;
  font-family: PingFang SC-Medium, PingFang SC;
  font-weight: 500;
  color: #FF3333;
  line-height: 32px;
}
.bigVideoDetail .bigVideoDetail-right .car-description {
  width: 100%;
  height: 110px;
  display: -webkit-box;
  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: 16px;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #E8E8E8;
  line-height: 28px;
  margin-top: 12px;
  text-indent: 36px;
  margin-bottom: 60px;
}
.commentmodel {
  position: absolute;
  right: 0;
  top: 0;
  background: #222;
  width: 380px;
  box-sizing: border-box;
  height: calc(100%);
  padding: 24px;
  transition: right 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
	z-index: 10;
}
.rightBoxVisible{
	right: 0px;
}
.rightBoxHidden{
	right: -400px;
}
.commentmodel .commentTitle {
  color: #E8E8E8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}
.commentmodel .commentTitle .commentTitleLeft {
  height: 20px;
  font-size: 20px;
  font-weight: 500;
  color: #E8E8E8;
  line-height: 20px;
}
.commentmodel .commentTitle .iconfont {
  font-size: 24px;
}
.QRcode {
  width: 128px;
  height: 158px;
  background: #fff;
  position: absolute;
  right: 112px;
  bottom: 140px;
}

</style>